Previous Book Contents Book Index Next

Inside Macintosh: 3D Graphics Programming With QuickDraw 3D /
Chapter 18 - QuickDraw 3D Pointing Device Manager / QuickDraw 3D Pointing Device Manager Reference
QuickDraw 3D Pointing Device Manager Routines / Creating and Managing Trackers


Q3Tracker_GetOrientation

You can use the Q3Tracker_GetOrientation function to get the current orientation of a tracker.

TQ3Status Q3Tracker_GetOrientation (
TQ3TrackerObject trackerObject, 
TQ3Quaternion *orientation, 
TQ3Quaternion *delta, 
TQ3Boolean *changed, 
unsigned long *serialNumber);
trackerObject
A tracker object.
orientation
On exit, the current orientation of the specified tracker.
delta
On exit, the change in orientation since the last call to Q3Tracker_GetOrientation.
changed
On exit, a Boolean value that indicates whether the orientation or delta parameters was changed (kQ3True) or not (kQ3False).
serialNumber
On entry, a tracker serial number, or NULL. On output, the current tracker serial number.
DESCRIPTION
The Q3Tracker_GetOrientation function returns, in the orientation parameter, the current orientation of the tracker specified by the trackerObject parameter. In addition, it may return, in the delta parameter, the relative change in orientation since the previous call to Q3Tracker_GetOrientation.

On entry, if the value of delta is NULL, the relative contribution is combined into the reported orientation. If the value of delta is not NULL, then delta is set to the relative motion that has been accumulated since the previous call to Q3Tracker_GetOrientation. In either case, the orientation accumulator is set to identity by this function.

If the value of the serialNumber parameter is NULL, Q3Tracker_GetOrientation fills in the orientation and delta parameters and returns the value kQ3True in the changed parameter. Otherwise, the value specified in the serialNumber parameter is compared with the tracker's current serial number. If the two serial numbers are identical, Q3Tracker_GetOrientation leaves the two coordinate parameters and the serialNumber parameter unchanged and returns the value kQ3False in the changed parameter. If the two serial number differ, Q3Tracker_GetOrientation fills in the two coordinate parameters, updates the serialNumber parameter, and returns the value kQ3True in the changed parameter.

If the specified tracker is inactive, then the orientation parameter is set to identity, the delta parameter is set to identity if it is non-NULL, and the changed parameter is set to kQ3False if it is non-NULL.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996